#ifndef PATTERNVIEW_H
#define PATTERNVIEW_H

#include <allegro5/allegro5.h>
#include "rect.h"
#include "editorview.h"
class App;
class Font;
class Event;

class PatternView : public EditorView {
public:
     PatternView(App *pApp, Rect rect, Font *pFont);
     void paint(bool all=false);
     void keyDown(int keycode, int modifiers, int unichar);
     void setRect(Rect rect);
     int playerRow();
     void setPlayerRow(int row);
     bool playing();
     void setPlaying(bool playing);
     void update();

private:
     int m_playerRow;
     bool m_playing;

     void paintPattern(Rect rect);
     void paintTrack(int col, Rect rect);
     void paintEvent(Event *pEvent, Rect rect, bool highlight=false);
     void toggleEventType();
     void decRow();
     void incRow();
};

#endif
